package com.api.cdfortis.task;

import com.api.cdfortis.util.WwzUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时任务：更新token
 */
@Component
public class TokenTask {
    @Autowired
    private WwzUtil wwzUtil;

    //@Scheduled(cron = "0 0/30 * * * ?")
    public void execGetToken() {
        WwzUtil.TOKEN = wwzUtil.createToken();
        System.out.println(">>>>>>>>>>>>>>定时更新token, 最新token=" + WwzUtil.TOKEN + "，更新时间为" + System.currentTimeMillis());
    }

}
